package edu.smxy.associationmanagement.services.classperiod.impl;

import edu.smxy.associationmanagement.domain.ClassPeriod;
import edu.smxy.associationmanagement.mapper.ClassPeriodMapper;
import edu.smxy.associationmanagement.services.classperiod.ClassPeriodService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
/**
 * ClassPeriod 服务层接口实现类
 *
 * @date 2019/04/18
 * @author: : SDH
 * @description: 指导记录服务层接口实现类
 */
@Service("ClassPeriodService")
public class ClassPeriodServiceImpl implements ClassPeriodService {
  @Autowired ClassPeriodMapper classPeriodMapper;
  /**
   * 根据id删除ClassPeriod数据
   *
   * @param classperiodId id
   * @return 数据库受影响行数
   */
  @Override
  public int deleteByPrimaryKey(final Integer classperiodId) {
    return this.classPeriodMapper.deleteByPrimaryKey(classperiodId);
  }
  /**
   * 插入ClassPeriod数据
   *
   * @param record ClassPeriod对象
   * @return 数据库受影响的行数
   */
  @Override
  public int insert(final ClassPeriod record) {
    return this.classPeriodMapper.insert(record);
  }
  /**
   * 安全插入ClassPeriod数据
   *
   * @param record ClassPeriod对象
   * @return 数据库受影响行数
   */
  @Override
  public int insertSelective(final ClassPeriod record) {
    return this.classPeriodMapper.insertSelective(record);
  }
  /**
   * 根据id查询ClassPeriod数据
   *
   * @param classperiodId id
   * @return 查询到的ClassPeriod对象
   */
  @Override
  public ClassPeriod selectByPrimaryKey(final Integer classperiodId) {
    return this.classPeriodMapper.selectByPrimaryKey(classperiodId);
  }
  /**
   * 安全更新ClassPeriod数据
   *
   * @param record ClassPeriod对象
   * @return 数据库受影响的行数
   */
  @Override
  public int updateByPrimaryKeySelective(final ClassPeriod record) {
    return this.classPeriodMapper.updateByPrimaryKeySelective(record);
  }
  /**
   * 更新ClassPeriod数据
   *
   * @param record ClassPeriod对象
   * @return 数据库受影响行数
   */
  @Override
  public int updateByPrimaryKey(final ClassPeriod record) {
    return this.classPeriodMapper.updateByPrimaryKey(record);
  }
  /**
   * 根据协会id获得所有指导记录
   *
   * @param assId 协会id
   * @return List<ClassPeriod> ClassPeriod集合
   */
  @Override
  public List<ClassPeriod> getAllByAssid(final int assId) {
    return this.classPeriodMapper.getAllByAssid(assId);
  }
}
